"use strict";

/*
|--------------------------------------------------------------------------
| Routes
|--------------------------------------------------------------------------
|
| Http routes are entry points to your web application. You can create
| routes for different URLs and bind Controller actions to them.
|
| A complete guide on routing is available here.
| http://adonisjs.com/docs/4.0/routing
|
*/

/** @type {typeof import('@adonisjs/framework/src/Route/Manager')} */
const Route = use("Route");

Route.group(() => {
  Route.post("register", "UserController.register");
  Route.post("login", "UserController.login");
  Route.get("list", async ({ request, response }) => {
    return {
      message: true,
      data: [
        {
          id: 1,
          name: "johnsong",
          age: 27
        },
        {
          id: 2,
          name: "tomas",
          age: 21
        },
        {
          id: 3,
          name: "critinsna",
          age: 23
        }
      ]
    };
  });
}).prefix("user");
